<div class="portlet light bordered">
	<div class="portlet-title">
		<div class="caption font-dark">
			<i class="fa fa-cog font-dark"></i> 
			<span class="caption-subject bold">新增推荐分类</span>
		</div>
	</div>
	<div class="portlet-body form">
		<form role="form" action="/categoryRecommend/add" class="form-horizontal" method="post" enctype="multipart/form-data">
			<div class="modal-body">
				<div class="form-group">
					<label class="control-label col-md-3">*推荐类别：</label>
					<div class="col-md-7">
						<select name="categoryId" class="form-control" required>
							#foreach($category1 in $!categoryList)
							#if($category1.level==1)
							<optgroup label="$category1.name">
								#foreach($category2 in $!categoryList)
								#if($category2.pid==$category1.id)
								<option value="$category2.id">$category2.name</option>
								#end
								#end
							</optgroup>
							#end
							#end
						</select>
					</div>
				</div>
				<div class="form-group">
                <label class="control-label col-md-3">*图片:</label>
					<div class="col-md-7">
				    	<div class="fileinput fileinput-new" data-provides="fileinput">
							<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
							    <img src="/assets/images/upload.png" alt="上传图片"> 
							</div>
							<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
							<div>
								<span class="btn default btn-file">
									<span class="fileinput-new"> 浏览 </span>
								    <span class="fileinput-exists"> 更改 </span>
								    <input type="file" id="file" name="file" accept="image/jpg,image/gif,image/bmp,image/jpeg,image/png" required> 
							    </span>
							    <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> 删除 </a>
							</div>
				    	</div>
					</div>
				</div>
				<div class="form-actions right">
	                 <a href="javascript:;" thref="/categoryRecommend/list?$!queryReturn" class="btn green ajax-file"><i class="fa fa-check"></i> 提交</a>
	                 <a href="javascript:;" data-dismiss="modal" class="btn btn-outline grey-salsa">返回</a>
	            </div>
	    	</div>
		</form>
	</div>
</div>
<script src="/assets/scripts/views-file-add.js" type="text/javascript"></script>
<script type="text/javascript">
	ComponentsSelect2.initWithSearch()
</script>